home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{5A65A9C0-089F-11D2-88AD-0000B45C4CF6}#1.2#0"; "EASYX.OCX"
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 3195
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4680
- Icon = "Form1.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 3195
- ScaleWidth = 4680
- StartUpPosition = 3 'Windows Default
- Begin PROJECTEXLibCtl.EasyX EasyX
- Left = 960
- OleObjectBlob = "Form1.frx":014A
- Top = 120
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim TextSurface As Long
- Dim TextSprite As Long
- Const pTextHeight As Long = 100
- Const pTextWidth As Long = 200
- Const ScreenWidth As Long = 640
- Const ScreenHeight As Long = 480
- Dim XPoint As Long, YPoint As Long
- Const MovePrLoop As Long = 1
- Private Sub RunMain()
- EasyX.FillSurface RGB(255, 255, 255), EX_PRIMARYSURFACE
- EasyX.DrawSprite XPoint, YPoint, pTextWidth, pTextHeight, TextSprite
- 'update the movement variables
- YPoint = YPoint - MovePrLoop
- If YPoint + pTextHeight < 0 Then
- YPoint = ScreenHeight
- EasyX.EndDirectX
- Unload Me
- Exit Sub
- End If
- EasyX.FlipSurface
- DoEvents
- End Sub
- Private Sub Form_Load()
- Dim rt As Long
- Dim AppPath As String
- 'Do not forget this
- EasyX.Window = Me.hWnd
- AppPath = App.Path & "\"
- rt = EasyX.InitDirectDraw(ScreenWidth, ScreenHeight, 8)
- If rt <> EX_OK Then
- EasyX.EndDirectX
- MsgBox "Direct Draw could not initialize", vbOKOnly, "Failure"
- Exit Sub
- End If
- 'Set the surfacetext
- TextSurface = EasyX.LoadBitmapFile(AppPath & "textsurface.bmp", 0)
- If TextSurface < 0 Then
- EasyX.EndDirectX
- MsgBox "Direct Draw could create text surface", vbOKOnly, "Failure"
- Exit Sub
- End If
- EasyX.SetText TextSurface, RGB(255, 255, 255), 0, 14, "Verdana"
- TextSprite = EasyX.MakeSprite(0, 0, 200, 100, TextSurface)
- 'Print the text
- EasyX.PrintText TextSurface, "This is a scrolling text example" & vbCrLf _
- & "Use Newline characters to print to a new line" _
- & vbCrLf & vbCrLf & " EasyX ver 1.2", 0, 0, 200, 100
- 'initialize the movement variables
- YPoint = ScreenHeight
- XPoint = ScreenWidth / 2 - pTextWidth / 2
- RunMain
- End Sub
-